package com.frame.database;

import java.lang.reflect.ParameterizedType;
import net.sf.cglib.proxy.Enhancer;
import com.frame.database.proxy.JServiceProxy;

/**
 * @Title: 系统
 * @Description:
 * @Copyright: Copyright (c) 2015
 * @Company:
 * @author 王海锋
 * @CreatedTime:2015-6-26 上午09:47:07
 * @version 1.0
 */

public class JServiceFactory {

    public static JBaseService createJServiceProxy(Class c){
        ParameterizedType pt = (ParameterizedType)c.getGenericSuperclass();
        Class daoClass=(Class)pt.getActualTypeArguments()[0];
        JServiceProxy proxy=new JServiceProxy();
        proxy.setDaoClass(daoClass);
        return (JBaseService)Enhancer.create(c, proxy);
    }
}
